package com.nhc.database.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.nhc.database.dbmodel.Measure;
import com.nhc.database.dbmodel.MeasurePoint;
import com.nhc.database.dbmodel.QiyaInfo;
import com.nhc.database.dbmodel.Route;
import com.nhc.database.dbmodel.SystemAllInfo;
import com.nhc.database.dbmodel.TrackPoint;
import com.nhc.database.dbmodel.WayPoint;
import com.nhc.database.dbmodel.WayTrail;

import com.nhc.database.greendao.MeasureDao;
import com.nhc.database.greendao.MeasurePointDao;
import com.nhc.database.greendao.QiyaInfoDao;
import com.nhc.database.greendao.RouteDao;
import com.nhc.database.greendao.SystemAllInfoDao;
import com.nhc.database.greendao.TrackPointDao;
import com.nhc.database.greendao.WayPointDao;
import com.nhc.database.greendao.WayTrailDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig measureDaoConfig;
    private final DaoConfig measurePointDaoConfig;
    private final DaoConfig qiyaInfoDaoConfig;
    private final DaoConfig routeDaoConfig;
    private final DaoConfig systemAllInfoDaoConfig;
    private final DaoConfig trackPointDaoConfig;
    private final DaoConfig wayPointDaoConfig;
    private final DaoConfig wayTrailDaoConfig;

    private final MeasureDao measureDao;
    private final MeasurePointDao measurePointDao;
    private final QiyaInfoDao qiyaInfoDao;
    private final RouteDao routeDao;
    private final SystemAllInfoDao systemAllInfoDao;
    private final TrackPointDao trackPointDao;
    private final WayPointDao wayPointDao;
    private final WayTrailDao wayTrailDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        measureDaoConfig = daoConfigMap.get(MeasureDao.class).clone();
        measureDaoConfig.initIdentityScope(type);

        measurePointDaoConfig = daoConfigMap.get(MeasurePointDao.class).clone();
        measurePointDaoConfig.initIdentityScope(type);

        qiyaInfoDaoConfig = daoConfigMap.get(QiyaInfoDao.class).clone();
        qiyaInfoDaoConfig.initIdentityScope(type);

        routeDaoConfig = daoConfigMap.get(RouteDao.class).clone();
        routeDaoConfig.initIdentityScope(type);

        systemAllInfoDaoConfig = daoConfigMap.get(SystemAllInfoDao.class).clone();
        systemAllInfoDaoConfig.initIdentityScope(type);

        trackPointDaoConfig = daoConfigMap.get(TrackPointDao.class).clone();
        trackPointDaoConfig.initIdentityScope(type);

        wayPointDaoConfig = daoConfigMap.get(WayPointDao.class).clone();
        wayPointDaoConfig.initIdentityScope(type);

        wayTrailDaoConfig = daoConfigMap.get(WayTrailDao.class).clone();
        wayTrailDaoConfig.initIdentityScope(type);

        measureDao = new MeasureDao(measureDaoConfig, this);
        measurePointDao = new MeasurePointDao(measurePointDaoConfig, this);
        qiyaInfoDao = new QiyaInfoDao(qiyaInfoDaoConfig, this);
        routeDao = new RouteDao(routeDaoConfig, this);
        systemAllInfoDao = new SystemAllInfoDao(systemAllInfoDaoConfig, this);
        trackPointDao = new TrackPointDao(trackPointDaoConfig, this);
        wayPointDao = new WayPointDao(wayPointDaoConfig, this);
        wayTrailDao = new WayTrailDao(wayTrailDaoConfig, this);

        registerDao(Measure.class, measureDao);
        registerDao(MeasurePoint.class, measurePointDao);
        registerDao(QiyaInfo.class, qiyaInfoDao);
        registerDao(Route.class, routeDao);
        registerDao(SystemAllInfo.class, systemAllInfoDao);
        registerDao(TrackPoint.class, trackPointDao);
        registerDao(WayPoint.class, wayPointDao);
        registerDao(WayTrail.class, wayTrailDao);
    }
    
    public void clear() {
        measureDaoConfig.clearIdentityScope();
        measurePointDaoConfig.clearIdentityScope();
        qiyaInfoDaoConfig.clearIdentityScope();
        routeDaoConfig.clearIdentityScope();
        systemAllInfoDaoConfig.clearIdentityScope();
        trackPointDaoConfig.clearIdentityScope();
        wayPointDaoConfig.clearIdentityScope();
        wayTrailDaoConfig.clearIdentityScope();
    }

    public MeasureDao getMeasureDao() {
        return measureDao;
    }

    public MeasurePointDao getMeasurePointDao() {
        return measurePointDao;
    }

    public QiyaInfoDao getQiyaInfoDao() {
        return qiyaInfoDao;
    }

    public RouteDao getRouteDao() {
        return routeDao;
    }

    public SystemAllInfoDao getSystemAllInfoDao() {
        return systemAllInfoDao;
    }

    public TrackPointDao getTrackPointDao() {
        return trackPointDao;
    }

    public WayPointDao getWayPointDao() {
        return wayPointDao;
    }

    public WayTrailDao getWayTrailDao() {
        return wayTrailDao;
    }

}
